import request from '@/utils/request'

// 查询产品分类列表
export function listClassification(query) {
  return request({
    url: '/store/classification/list',
    method: 'get',
    params: query
  })
}

// 查询产品分类详细
export function getClassification(classId) {
  return request({
    url: '/store/classification/' + classId,
    method: 'get'
  })
}

// 新增产品分类
export function addClassification(data) {
  return request({
    url: '/store/classification',
    method: 'post',
    data: data
  })
}

// 修改产品分类
export function updateClassification(data) {
  return request({
    url: '/store/classification',
    method: 'put',
    data: data
  })
}

// 删除产品分类
export function delClassification(classId) {
  return request({
    url: '/store/classification/' + classId,
    method: 'delete'
  })
}

// 添加分类时查询父级分类
export function queryTypeList(classId) {
  return request({
    url: '/store/classification/queryTypeList',
    method: 'get'
  })
}
